package com.anzia.study_3;

import com.anzia.study_3.slice.MainAbility2Slice;
import com.anzia.study_3.slice.MainAbilitySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

public class MainAbility extends Ability {

    static final HiLogLabel LOG_LABEL = new HiLogLabel(HiLog.LOG_APP, 0x11101, "MainAbility");

    @Override
    public void onStart(Intent intent) {
        HiLog.info(LOG_LABEL, "============onStart");
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());

        requestPermissionsFromUser(new String[]{"ohos.permission.DISTRIBUTED_DATASYNC"}, 0);
    }

    @Override
    protected void onActive() {
        HiLog.info(LOG_LABEL, "============onActive");

        super.onActive();
    }

    @Override
    protected void onInactive() {
        HiLog.info(LOG_LABEL, "============onInactive");

        super.onInactive();
    }

    @Override
    protected void onForeground(Intent intent) {
        HiLog.info(LOG_LABEL, "============onForeground");

        super.onForeground(intent);
    }

    @Override
    protected void onBackground() {
        HiLog.info(LOG_LABEL, "============onBackground");

        super.onBackground();
    }

    @Override
    protected void onStop() {
        HiLog.info(LOG_LABEL, "============onStop");

        super.onStop();
    }
}
